﻿using System.Collections.Generic;
using System;
namespace Comsenz.Services.Blocks.Configs
{
    /// <summary>
    /// 模块的显示样式
    /// </summary>
    /// <author>Chiron</author>
    public class BlockStyle
    {
        #region Ctors
        /// <summary>
        /// 构建显示样式
        /// </summary>
        public BlockStyle()
        {
        }
        /// <summary>
        /// 显示样式
        /// </summary>
        /// <param name="name">模板名称</param>
        /// <param name="template">模板</param>
        public BlockStyle(string name, string template)
        {
            Name = name;
            Template = template;
        }
        #endregion Ctors

        #region Props
        private string name;
        /// <summary>
        /// 模板名称
        /// </summary>
        public string Name
        {
            get
            {
                return name;
            }
            set
            {
                if (string.IsNullOrEmpty(value)) throw new ArgumentNullException("name");
                name = value;
            }
        }
        /// <summary>
        /// 模板
        /// </summary>
        public string Template { get; set; }
        #endregion Props


        /// <summary>
        /// 取得配置值
        /// </summary>
        /// <returns></returns>
        public Dictionary<object, object> GetConfigValue()
        {
            return new Dictionary<object, object>
            {
                {"name",Name},
                {"template",Template}
            };
        }
    }
}
